/**
* @description: 标准化作业--检修备件-查看
* @author: wqn&yanxiaoyue
* @data:2023年6月15日-2023年7月10日
* @remark:
**/
<template>
	<view class="maintenance">
		<nav-bar title="检修备件-查看" @goBack="goBack"></nav-bar>
		<view class="main">
			<view>
				<!--      全选部分-->
				<view class="title layout">
					<text>检修备件</text>
				</view>
				<!--      检修的仪器-->
				<view class="content-list" v-for="(item,index) in sparePart" :key="index">
					<view class="border">
						<view class="list-top layout">
							<img style="width: 22px;height: 22px;" src="../../../static/standardizedOperationImg/zxckBlue.png"
								alt="">
							<text>{{ item.deviceClass }}</text>
						</view>
						<view class="list-bottom" v-for="(pro,index) in item.jxsblist" :key="index">
							<van-divider />
							<view class="details layout">
								<text>{{ pro.bjType }}{{ pro.existingNum }}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import navBar from '../../../components/common/nav-bar.vue'
	import {
		Dialog
	} from "vant";
	import {
		selectjxbjopticallog
	} from "../../../api/bzhzyApi";

	export default {
		name: "index",
		components: {
			navBar
		},
		data() {
			return {
				activeIcon: require('../../../static/img/no-click.png'),
				inactiveIcon: require('../../../static/img/clicked.png'),
				sparePart: [],
			}
		},
		onLoad(option) {
			this.work = JSON.parse(option.pushParam)
			this.getSelectJxbjOptical();
		},
		methods: {
			goBack() {
				uni.navigateBack()
			},
			// 获取所有检修备件
			getSelectJxbjOptical() {
				this.$apiRequest.bzhzyApi.selectjxbjopticallog({
					workPlanId: this.work.id,
					consultationDeductionId: this.work.OBJID,
					pageFlag: this.work.pageFlag
				}).then(res => {
					console.log(res.data);
					this.sparePart = res.data
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.maintenance {
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 100vh;
		background: #F2F6FA;
		overflow: hidden;

		.main {
			flex: 1;
			padding: px2vh(30);
			overflow: scroll;
			box-sizing: border-box;

			.clickIcon {
				width: 13px;
				height: 13px;
			}

			text {
				font-size: px2vh(40);
				font-weight: bold;
				color: #666666;
			}

			.layout {
				display: flex;
				align-items: center;
			}

			.title {
				margin-bottom: px2vh(30);

				text:nth-child(1) {
					flex: 1;
				}

				text:last-child {
					color: #98999B;
				}

				.active {
					color: #417ADC !important;
				}

				img {
					margin-right: px2vw(16);
				}
			}

			.content-list {
				// width: px2vw(1020);
				background: #FFFFFF;
				margin-bottom: px2vh(30);
				border-radius: px2vh(20);

				.border {
					margin: auto px2vw(50);
					padding: px2vh(50) 0;
				}

				.list-top {
					text {
						margin-right: auto;
						margin-left: px2vh(18);
					}
				}

				.list-bottom {
					.details {
						height: px2vh(74);

						text {
							flex: 1;
							font-size: px2vh(42);
							font-weight: normal;
						}
					}
				}
			}

			.verify {
				margin: px2vh(76) 0;

				.van-button--normal {
					width: 100%;
					height: px2vh(120);
					font-size: px2vh(46);
					background: #417ADC;
					border: 1px solid #417ADC;
				}
			}
		}
	}

	.img-icon {
		width: 13px;
		height: 13px;
	}
</style>
